package com.lepu.app.fun.tool.szqx.view;

import java.util.ArrayList;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.ListView;

import com.app.utils.LoginUtil;
import com.eyzhs.app.R;
import com.lepu.app.fun.tool.szqx.adapter.GrowDataAdapter;
import com.lepu.app.fun.tool.szqx.bean.BeanToolGrow;

public class GrowDataView extends LinearLayout {

	private Context mContext;
	private ListView mListView;
	private GrowDataAdapter mAdapter;
	private ArrayList<BeanToolGrow> mDataList;
	
	private int mType = 1;

	public GrowDataView(Context context, int type) {
		super(context);

		mContext = context;
		mType = type;
		LayoutInflater.from(mContext).inflate(R.layout.tool_grow_fragment_data,this, true);
		init();
	}

	public GrowDataView(Context context, AttributeSet attrs) {
		super(context, attrs);
		mContext = context;
		LayoutInflater.from(mContext).inflate(R.layout.tool_grow_fragment_data,this, true);
		init();
	}

	private void init() {
		mListView = (ListView)findViewById(R.id.listview);
		
		mDataList = BeanToolGrow.getDataByUidDesc(LoginUtil.getUserId());
		mAdapter = new GrowDataAdapter(mContext,mDataList,mType);
		mListView.setAdapter(mAdapter);
	}

}
